
{if !$id}
	{assign var="id" value="-1"}
{/if}

{if !$depth}
	{assign var="depth" value="0"}
{/if}

{assign var="name" value="name$id"}

{foreach name=$name item="category" from=$catalog->getCategories($id)}
	{if $smarty.foreach.$name.first}
<ul>
	{/if}
	<li><a href="{$smarty.const.HTTP_SERVER}/catalog/catalog.php?view=core.category&amp;cPath={$category->getId()}">
	{$category->getName()|indent:1|indent:$depth:#MENU_CATEGORIES_INDENT_CHAR#}</a>&nbsp;({$category->getProductCount()}){if $recursive}{include file=$theme->getTemplateUrl("menu_categories.tpl") id=$category->getId() recursive="true" depth=$depth+1}{/if}</li>
	{if $smarty.foreach.$name.last}
</ul>
	{/if}
{/foreach}

